<?php


   $filename=time().mt_rand(10000,99999).strrchr($_FILES['file']['name'],'.');

   $bool=move_uploaded_file($_FILES['file']['tmp_name'], '../../static/uploads/'.$filename);

   $res=["code"=>0,"msg"=>'上传文件失败'];
   if($bool){
      $res['code']=1;
      $res['msg']='文件上传成功';
      $res['src']="/static/uploads/".$filename;
   }
   echo json_encode($res);
?>